<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input id="text",value="">
    <button id="btn">打开子窗口</button>
    <button id="send">向子窗口发送数据</button>


    <script>
        var oText=document.querySelector("#text");
        var oBtn=document.querySelector("#btn");
        var oSend=document.querySelector("#send");

        var zi;
        oBtn.onclick=function(){
            zi=open("./zi.html","子窗口","width=600px,height=600px,left=300px,top=100px");
        }


        oSend.onclick=function(){
            var str=oText.value;
            zi.document.getElementById("text").value=str;
        }
    </script>
</body>
</html>